<form action="{{ action }}" method="{{ method }}"{% if hasFiles %} enctype="multipart/form-data"{% endif %} class="well form-vertical" />
	  
	  {% for relationName, relation in relations %}
		<label for="{{ relationName }}">{{ relation.comment }}</label>
		{% if relation.type=="many-to-one" %}
			{{ helper.select(relationName, relation )|raw }}
		{% endif %}
	  {% endfor %}
	  
	  {% for columnName, column in columns %}
		{% if columnName != ID %}
			{% set element = attribute(object, columnName) %}
			<label for="{{ columnName }}">{{ column.comment }}</label>
			{{ element.__toForm()|raw }}
		{% endif %}
	  {% endfor %}
	  
	  {% if mode == 'edit' %}
	  <input type="hidden" name="{{ ID }}" value="{{ object[ID] }}" />
	  <input type="hidden" name="mode" value="edit" />
	  {% else %}
	  <input type="hidden" name="mode" value="add" />
	  {% endif %}
	  
	  <div class="form-actions">
		  {% if mode == 'edit' %}
		  <button type="submit" class="btn btn-primary" />Сохранить</button>
		  {% else %}
		  <button type="submit" class="btn btn-primary" />Добавить</button>
		  {% endif %}
	  </div>
	  
</form>